﻿using System.Data.Entity.ModelConfiguration;
namespace wh40klbModel.ModelConfiguration
{
    class TypeVehiculeConfiguration : EntityTypeConfiguration<TypeVehicule>
    {
        public TypeVehiculeConfiguration()
        {
            //Cle Primaire et table
            HasKey(tv => tv.Id);
            //Propriete
            Property(tv => tv.Name).IsRequired().HasMaxLength(25);
            Property(tv => tv.Description).IsOptional();
            //cle etrangere
            HasMany(tv => tv.Vehicules).WithMany(v => v.TypeVehicules);
        }
    }
}
